import Home from '../views/Home.vue'

export default [
  { path: '/', redirect: '/home' },
  { path: '/home', name: 'Home', component: Home },
  {
    path: '/about', name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
    children: [
      {
        path: "message",
        component: () => import('../views/about/Message.vue')
      },
      {
        path: "hobby",
        component: () => import('../views/about/Hobby.vue')
      },
      {
        path:"",
        redirect: '/about/message'
      }
    ]
  },
  { path: '/user/:username', name: 'User', component: () => import('../views/User.vue') },
  // /:pathMatch(.*) -->$route.params.pathMatch--> user/chanqi/id/111
  // /:pathMatch(.*)* -->$route.params.pathMatch--> [ "user", "chanqi", "id", "111" ]
  {
    path: '/:pathMatch(.*)',
    name: 'NotFound', component: () => import('../views/NotFound.vue')
  },

]